#ifndef __PTHREAD_POOL__
#define __PTHREAD_POOL__
#include <zzh_header.h>
#include "tidArr.h"
#include "taskQueue.h"
typedef struct threadPool_s{
    // 子线程的信息
    tidArr_t tidArr;
    // 任务队列
    taskQueue_t taskQueue;
    // 锁
    pthread_mutex_t mutex;
    //条件变量
    pthread_cond_t cond;
    // 退出标志位
    int exitFlag;
}threadPool_t;

typedef struct train_s{
    int cmd;
    int length;
    char data[1000];
}train_t;

int threadPoolInit(threadPool_t *pthreadPool,int workerNum);
int tcpInit(char *ip, char *port);
int epollAdd(int epfd, int fd);
int epollDel(int epfd, int fd);
int makeWorker(threadPool_t *pthreadPool);
int transfile(int sockfd);
int recvn(int sockfd, void *buf,ssize_t length);
int recvfile(int sockfd);
#endif
